package cn.edu.fzu.homemaking.io;

import java.util.List;

import lombok.Data;

@Data
public class DingDingMessage {

    private static final String MARKDOWN = "markdown";

    private String              msgtype;
    private MarkdownMessage     markdown;

    private DingDingAt          at;

    public DingDingMessage(MarkdownMessage markdown, DingDingAt at) {
        this.msgtype = MARKDOWN;
        this.markdown = markdown;
        this.at = at;
    }


    public static DingDingMessage build(String title, String content, List<String> mobiles, String... items) {
        return new DingDingMessage(new MarkdownMessage(mobiles, title, content, items), new DingDingAt(mobiles, null));
    }

}
